(* Author: Thomas H. Handel, PeopleLink ID -- THH -- *)
(* I'm still learning Modula-2 and programming on Amy, so this may not
be the tidiest or best way to do what the program does. Also, it is
probably not the most elegant example of structured programming ever
created. Finally, I am certain that there are many enhancements that
more experienced programmers will be able to add (like maybe a close
gadget and the wherewithall to respond to it). Please fiddle at will. If you have comments or suggestions, please contact me on PeopleLink or by U.S. Snail at:
628 Harberts Ct.
Annapolis, MD 21401
Thanks in advance. *)
(* Placed in the Public Domain, 29 March 1987 *)
FROM SYSTEM IMPORT ADR, BYTE, NULL;
FROM Intuition IMPORT NewWindow, WindowPtr, IntuitionName, IntuitionBase,
WindowFlags, WindowFlagSet, IDCMPFlagSet,
CloseWindowFlag, ScreenFlagSet, WBenchScreen,
SmartRefresh,IntuiMessagePtr;
FROM Libraries IMPORT OpenLibrary, CloseLibrary;
FROM Windows IMPORT OpenWindow, CloseWindow;
FROM Strings IMPORT String;
FROM Pens IMPORT ReadPixel, WritePixel, SetAPen;
FROM GraphicsLibrary IMPORT GraphicsName, GraphicsBase;
FROM Ports IMPORT GetMsg, ReplyMsg, MessagePtr;
FROM Rasters IMPORT RastPortPtr;
FROM Storage IMPORT ALLOCATE, DEALLOCATE;
FROM RandomNumbers IMPORT Random;
VAR WPtr: WindowPtr;
NWin: NewWindow;
WNam: String;
RprtPtr: RastPortPtr;
MsgPtr : IntuiMessagePtr;
PROCEDURE Initialize(): BOOLEAN; (* Open the libraries *)
BEGIN
IntuitionBase := OpenLibrary(IntuitionName,0);
GraphicsBase := OpenLibrary(GraphicsName,0);
IF ((IntuitionBase = 0) OR (GraphicsBase = 0)) THEN RETURN FALSE
ELSE RETURN TRUE;
END;
END Initialize;
PROCEDURE InitWindow; (* Set up and open the window *)